package exception;

/**
 * @author pranjal
 *
 * 
 */
public class GeneralException extends Exception {

	/**
	 * 
	 */	
	public GeneralException(Exception e, String shortMessage, int errorNumber, int errorType) {
		this.longMessage = e.getMessage();
		this.stackTrace = e.getStackTrace();
		this.shortMessage = shortMessage;
		this.errorNumber = errorNumber;
		this.errorType = errorType;
	}
		
	public GeneralException() {
		super();
	}

	/**
	 * @param arg0
	 */
	public GeneralException(String arg0) {
		super(arg0);
	}
	/**
	 * 
	 */
	public static int CONNECTIONERROR = 0;
	public static int DATAERROR = 1;
	public static int LOGICALERROR = 2;
	public static int VALIDATIONERROR = 3;
	public static int DUPLICATEENTRY = 4;  
	private String shortMessage;
	private String longMessage;
	private StackTraceElement[] stackTrace;
	private int errorNumber;
	private int errorType;
	
	/**
	 * @return
	 */
	public int getErrorNumber() {
		return errorNumber;
	}

	/**
	 * @return
	 */
	public String getLongMessage() {
		return longMessage;
	}

	/**
	 * @return
	 */
	public String getShortMessage() {
		return shortMessage;
	}

	/**
	 * @param string
	 */
	public void setErrorNumber(int string) {
		errorNumber = string;
	}

	/**
	 * @param string
	 */
	public void setLongMessage(String string) {
		longMessage = string;
	}

	/**
	 * @param string
	 */
	public void setShortMessage(String string) {
		shortMessage = string;
	}

	/**
	 * @return
	 */
	public int getErrorType() {
		return errorType;
	}

	/**
	 * @param i
	 */
	public void setErrorType(int i) {
		errorType = i;
	}

	/**
	 * @return
	 */
	public StackTraceElement[] getStackTrace() {
		return stackTrace;
	}

	/**
	 * @param elements
	 */
	public void setStackTrace(StackTraceElement[] elements) {
		stackTrace = elements;
	}

}